package com.afsadmedia.pregnancy;

import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.TextView;



public class CustomGridViewAdaptercheklist extends ArrayAdapter<ListItemSymptomSelect>{
	
	 Context context;
	  
	    public CustomGridViewAdaptercheklist(Context context, int resourceId,
	            List<ListItemSymptomSelect> items) {
	        super(context, resourceId, items);
	        this.context = context;
	    }
	 
	    /*private view holder class*/
	    private class ViewHolder {
	       
	        TextView txtdesc;
	 //       TextView txtimgpath;
	        CheckBox asi;
	        
	    }
	 
	    public View getView(int position, View convertView, ViewGroup parent) {
	        ViewHolder holder = null;
	        ListItemSymptomSelect listItem = getItem(position);
	 
	        LayoutInflater mInflater = (LayoutInflater) context
	                .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
	        if (convertView == null) {
	            convertView = mInflater.inflate(R.layout.gridcheklist, null);
	            holder = new ViewHolder();
	           
	            holder.txtdesc = (TextView)convertView.findViewById(R.id.tv_cheklist);
	      //      holder.txtimgpath = (TextView)convertView.findViewById(R.id.textView2_listitem);
	            holder.asi =(CheckBox)convertView.findViewById(R.id.checkBox_gridlist);
	            
	            if(Constants.ashish == "Note"){
	            	holder.asi.setVisibility(View.INVISIBLE);
	            }
	            
	            convertView.setTag(holder);
	        } else
	        	
	        	if(Constants.ashish == "Note"){
	            	holder.asi.setVisibility(View.INVISIBLE);
	            }
	            holder = (ViewHolder) convertView.getTag();
	       
	        holder.txtdesc.setText(listItem.getDescri());
	   //     holder.txtimgpath.setText(listItem.getImagepath());
	       
	        
	 
	        return convertView;
	    }
	    
	    
		     

}

